package com.hjm.java.service;

import android.content.Context;
import android.os.Handler;

import com.hjm.java.entity.Address;
import com.hjm.java.utils.HjmFailCallBack;
import com.hjm.java.utils.HjmSuccessObjectCallBack;

public class AddressService extends BaseService{
    public AddressService(Context mContext, Handler mHandler) {
        super(mContext, mHandler);
    }
    public void getAddressDef(HjmSuccessObjectCallBack<Address> successObjectCallBack, HjmFailCallBack failCallBack) {
        httpUtils.getByToken(baseUrl + "/address/def", Address.class, (isSuccess, address, msg) -> {
            mHandler.post(()->{
                if (isSuccess){
                    successObjectCallBack.onSuccess(address);
                } else {
                    failCallBack.onFail(msg);
                }
            });
        });
    }

    /**
     * 获取发货地址
     */
    public void getAddress(int id) {

    }
}
